/*
 * File:   VectorIterator.h
 * Author: Elevator
 *
 * Created on 12 Май 2013 г., 16:02
 */

#ifndef COMMON_VECTORITERATOR_H
#define COMMON_VECTORITERATOR_H

#include <vector>
#include "Common/Collections/IIterator.h"

template<typename C>
class VectorIterator : public IIterator<C> {
private:
	const typename std::vector<C>* _vector;
	typename std::vector<C>::const_iterator _iterator;

public:

	VectorIterator( const typename std::vector<C>* vector ) {
		_vector = vector;
		_iterator = _vector->begin( );
	}

	virtual void Start( ) {
		_iterator = _vector->begin( );
	}

	virtual void Next( ) {
		_iterator++;
	}

	virtual C Current( ) {
		return *_iterator;
	}

	virtual bool IsEnd( ) {
		return _iterator == _vector->end( );
	}

};

#endif	/* VECTORENUMERATOR_H */

